um-new">
- user_id=user_id,
- coupon_title=coupon.coupon_title,
- coupon_detail=coupon.coupon_detail,
- coupon_value=coupon.coupon_value,
- coupon_image=coupon.coupon_image,
- active_at=active_at,
- expire_at=expire_at,
- coupon_valid_period=coupon.coupon_valid_period,
- coupon_limit_model_ids=coupon.coupon_limit_model_ids,
- )
-
- user.coupon_expire_at = expire_at
- user.save()
+ UserCouponInfo.objects.create(
+ brand_id=coupon.brand_id,
+ brand_name=coupon.brand_name,
+ coupon_id=coupon_id,
+ user_id=user_id,
+ coupon_title=coupon.coupon_title,
+ coupon_detail=coupon.coupon_detail,
+ coupon_value=coupon.coupon_value,
+ coupon_image=coupon.coupon_image,
+ coupon_from='INTEGRAL_MALL',
+ active_at=tc.utc_datetime(),
+ expire_at=tc.utc_datetime(days=coupon.coupon_valid_period) if coupon.coupon_expire_type == CouponInfo.CHANGED_EXPIRED_TIME else coupon.coupon_expire_at,
+ coupon_valid_period=coupon.coupon_valid_period,
+ coupon_limit_model_ids=coupon.coupon_limit_model_ids,
+ is_coupon_admin_writeoff=coupon.is_coupon_admin_writeoff,
+ )
+
+ else:
+ # 发放会员权益
+ active_at = tc.utc_datetime()
+ expire_at = tc.utc_datetime(days=365)
+
+ rights = RightInfo.objects.filter(is_send_coupon=True, status=True)
+ for right in rights:
+ if user.level == UserInfo.MEMBER_LRC:
+ coupon_id = right.coupon_level1_id
+ coupon_num = right.coupon_level1_num
+ elif user.level == UserInfo.MEMBER_SILVER:
+ coupon_id = right.coupon_level2_id
+ coupon_num = right.coupon_level2_num
+ elif user.level == UserInfo.MEMBER_GOLD:
+ coupon_id = right.coupon_level3_id
+ coupon_num = right.coupon_level3_num
+ elif user.level == UserInfo.MEMBER_WHITE_GOLD:
+ coupon_id = right.coupon_level4_id
+ coupon_num = right.coupon_level4_num
+ elif user.level == UserInfo.MEMBER_BLACK_GOLD:
+ coupon_id = right.coupon_level5_id
+ coupon_num = right.coupon_level5_num
+
+ if not coupon_id:
+ continue
+
+ try:
+ coupon = CouponInfo.objects.get(coupon_id=coupon_id)
+ except CouponInfo.DoesNotExist:
+ continue
+
+ for _ in range(right.coupon_num or coupon_num):
+ UserCouponInfo.objects.create(
+ brand_id=coupon.brand_id,
+ brand_name=coupon.brand_name,
+ coupon_id=coupon_id,
+ user_id=user_id,
+ coupon_title=coupon.coupon_title,
+ coupon_detail=coupon.coupon_detail,
+ coupon_value=coupon.coupon_value,
+ coupon_image=coupon.coupon_image,
+ active_at=active_at,
+ expire_at=expire_at,
+ coupon_valid_period=coupon.coupon_valid_period,
+ coupon_limit_model_ids=coupon.coupon_limit_model_ids,
+ )
+
+ user.coupon_expire_at = expire_at
+ user.save()
close_old_connections()
@@ -2,6 +2,7 @@ |
||
| 2 | 2 |
|
| 3 | 3 |
import logging |
| 4 | 4 |
|
| 5 |
+from django.db import transaction |
|
| 5 | 6 |
from django_six import CompatibilityBaseCommand, close_old_connections |
| 6 | 7 |
from TimeConvert import TimeConvert as tc |
| 7 | 8 |
|
@@ -37,58 +38,59 @@ class Command(CompatibilityBaseCommand): |
||
| 37 | 38 |
brand_id = v.get('brand_id', '')
|
| 38 | 39 |
user_id = v.get('user_id', '')
|
| 39 | 40 |
|
| 40 |
- try: |
|
| 41 |
- user = UserInfo.objects.get(user_id=user_id) |
|
| 42 |
- except UserInfo.DoesNotExist: |
|
| 43 |
- continue |
|
| 44 |
- |
|
| 45 |
- active_at = user.coupon_expire_at |
|
| 46 |
- expire_at = tc.utc_datetime(user.coupon_expire_at, days=365) |
|
| 47 |
- |
|
| 48 |
- # 发放会员权益 |
|
| 49 |
- rights = RightInfo.objects.filter(is_send_coupon=True, is_continue_send_coupon=True, status=True) |
|
| 50 |
- for right in rights: |
|
| 51 |
- if user.level == UserInfo.MEMBER_LRC: |
|
| 52 |
- coupon_id = right.coupon_level1_id |
|
| 53 |
- coupon_num = right.coupon_level1_num |
|
| 54 |
- elif user.level == UserInfo.MEMBER_SILVER: |
|
| 55 |
- coupon_id = right.coupon_level2_id |
|
| 56 |
- coupon_num = right.coupon_level2_num |
|
| 57 |
- elif user.level == UserInfo.MEMBER_GOLD: |
|
| 58 |
- coupon_id = right.coupon_level3_id |
|
| 59 |
- coupon_num = right.coupon_level3_num |
|
| 60 |
- elif user.level == UserInfo.MEMBER_WHITE_GOLD: |
|
| 61 |
- coupon_id = right.coupon_level4_id |
|
| 62 |
- coupon_num = right.coupon_level4_num |
|
| 63 |
- elif user.level == UserInfo.MEMBER_BLACK_GOLD: |
|
| 64 |
- coupon_id = right.coupon_level5_id |
|
| 65 |
- coupon_num = right.coupon_level5_num |
|
| 66 |
- |
|
| 67 |
- if not coupon_id: |
|
| 68 |
- continue |
|
| 69 |
- |
|
| 41 |
+ with transaction.atomic(): |
|
| 70 | 42 |
try: |
| 71 |
- coupon = CouponInfo.objects.get(coupon_id=coupon_id) |
|
| 72 |
- except CouponInfo.DoesNotExist: |
|
| 43 |
+ user = UserInfo.objects.get(user_id=user_id) |
|
| 44 |
+ except UserInfo.DoesNotExist: |
|
| 73 | 45 |
continue |
| 74 | 46 |
|
| 75 |
- for _ in range(right.coupon_num or coupon_num): |
|
| 76 |
- UserCouponInfo.objects.create( |
|
| 77 |
- brand_id=coupon.brand_id, |
|
| 78 |
- brand_name=coupon.brand_name, |
|
| 79 |
- coupon_id=coupon_id, |
|
| 80 |
- user_id=user_id, |
|
| 81 |
- coupon_title=coupon.coupon_title, |
|
| 82 |
- coupon_detail=coupon.coupon_detail, |
|
| 83 |
- coupon_value=coupon.coupon_value, |
|
| 84 |
- coupon_image=coupon.coupon_image, |
|
| 85 |
- active_at=active_at, |
|
| 86 |
- expire_at=expire_at, |
|
| 87 |
- coupon_valid_period=coupon.coupon_valid_period, |
|
| 88 |
- coupon_limit_model_ids=coupon.coupon_limit_model_ids, |
|
| 89 |
- ) |
|
| 90 |
- |
|
| 91 |
- user.coupon_expire_at = expire_at |
|
| 92 |
- user.save() |
|
| 47 |
+ active_at = user.coupon_expire_at |
|
| 48 |
+ expire_at = tc.utc_datetime(user.coupon_expire_at, days=365) |
|
| 49 |
+ |
|
| 50 |
+ # 发放会员权益 |
|
| 51 |
+ rights = RightInfo.objects.filter(is_send_coupon=True, is_continue_send_coupon=True, status=True) |
|
| 52 |
+ for right in rights: |
|
| 53 |
+ if user.level == UserInfo.MEMBER_LRC: |
|
| 54 |
+ coupon_id = right.coupon_level1_id |
|
| 55 |
+ coupon_num = right.coupon_level1_num |
|
| 56 |
+ elif user.level == UserInfo.MEMBER_SILVER: |
|
| 57 |
+ coupon_id = right.coupon_level2_id |
|
| 58 |
+ coupon_num = right.coupon_level2_num |
|
| 59 |
+ elif user.level == UserInfo.MEMBER_GOLD: |
|
| 60 |
+ coupon_id = right.coupon_level3_id |
|
| 61 |
+ coupon_num = right.coupon_level3_num |
|
| 62 |
+ elif user.level == UserInfo.MEMBER_WHITE_GOLD: |
|
| 63 |
+ coupon_id = right.coupon_level4_id |
|
| 64 |
+ coupon_num = right.coupon_level4_num |
|
| 65 |
+ elif user.level == UserInfo.MEMBER_BLACK_GOLD: |
|
| 66 |
+ coupon_id = right.coupon_level5_id |
|
| 67 |
+ coupon_num = right.coupon_level5_num |
|
| 68 |
+ |
|
| 69 |
+ if not coupon_id: |
|
| 70 |
+ continue |
|
| 71 |
+ |
|
| 72 |
+ try: |
|
| 73 |
+ coupon = CouponInfo.objects.get(coupon_id=coupon_id) |
|
| 74 |
+ except CouponInfo.DoesNotExist: |
|
| 75 |
+ continue |
|
| 76 |
+ |
|
| 77 |
+ for _ in range(right.coupon_num or coupon_num): |
|
| 78 |
+ UserCouponInfo.objects.create( |
|
| 79 |
+ brand_id=coupon.brand_id, |
|
| 80 |
+ brand_name=coupon.brand_name, |
|
| 81 |
+ coupon_id=coupon_id, |
|
| 82 |
+ user_id=user_id, |
|
| 83 |
+ coupon_title=coupon.coupon_title, |
|
| 84 |
+ coupon_detail=coupon.coupon_detail, |
|
| 85 |
+ coupon_value=coupon.coupon_value, |
|
| 86 |
+ coupon_image=coupon.coupon_image, |
|
| 87 |
+ active_at=active_at, |
|
| 88 |
+ expire_at=expire_at, |
|
| 89 |
+ coupon_valid_period=coupon.coupon_valid_period, |
|
| 90 |
+ coupon_limit_model_ids=coupon.coupon_limit_model_ids, |
|
| 91 |
+ ) |
|
| 92 |
+ |
|
| 93 |
+ user.coupon_expire_at = expire_at |
|
| 94 |
+ user.save() |
|
| 93 | 95 |
|
| 94 | 96 |
close_old_connections() |
@@ -110,7 +110,7 @@ class MemberActivityContributionWelfareInfoAdmin(admin.ModelAdmin): |
||
| 110 | 110 |
|
| 111 | 111 |
|
| 112 | 112 |
class MemberActivityContributionWelfareUnlockingInfoAdmin(admin.ModelAdmin): |
| 113 |
- list_display = ('unlocking_id', 'admin_id', 'user_id', 'activity_id', 'contribution_id', 'welfare_id', 'name', 'phone', 'address', 'tracking_number', 'is_handled', 'status', 'created_at', 'updated_at')
|
|
| 113 |
+ list_display = ('unlocking_id', 'admin_id', 'user_id', 'activity_id', 'contribution_id', 'welfare_id', 'welfare_type', 'welfare_value', 'name', 'phone', 'address', 'tracking_number', 'is_handled', 'status', 'created_at', 'updated_at')
|
|
| 114 | 114 |
list_filter = ('admin_id', 'activity_id', 'welfare_id', 'is_handled', 'status')
|
| 115 | 115 |
|
| 116 | 116 |
|
@@ -0,0 +1,19 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+# Generated by Django 3.2.16 on 2022-10-27 10:38 |
|
| 3 |
+ |
|
| 4 |
+from django.db import migrations, models |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+class Migration(migrations.Migration): |
|
| 8 |
+ |
|
| 9 |
+ dependencies = [ |
|
| 10 |
+ ('member', '0045_auto_20221026_2102'),
|
|
| 11 |
+ ] |
|
| 12 |
+ |
|
| 13 |
+ operations = [ |
|
| 14 |
+ migrations.AddField( |
|
| 15 |
+ model_name='memberactivitycontributionwelfareunlockinginfo', |
|
| 16 |
+ name='welfare_value', |
|
| 17 |
+ field=models.IntegerField(default=0, help_text='福利数量', verbose_name='welfare_value'), |
|
| 18 |
+ ), |
|
| 19 |
+ ] |
@@ -0,0 +1,19 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+# Generated by Django 3.2.16 on 2022-10-27 10:46 |
|
| 3 |
+ |
|
| 4 |
+from django.db import migrations, models |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+class Migration(migrations.Migration): |
|
| 8 |
+ |
|
| 9 |
+ dependencies = [ |
|
| 10 |
+ ('member', '0046_memberactivitycontributionwelfareunlockinginfo_welfare_value'),
|
|
| 11 |
+ ] |
|
| 12 |
+ |
|
| 13 |
+ operations = [ |
|
| 14 |
+ migrations.AddField( |
|
| 15 |
+ model_name='memberactivitycontributionwelfareunlockinginfo', |
|
| 16 |
+ name='welfare_type', |
|
| 17 |
+ field=models.IntegerField(choices=[(0, '实物'), (1, '积分'), (2, '虚拟')], db_index=True, default=0, help_text='福利类型', verbose_name='welfare_type'), |
|
| 18 |
+ ), |
|
| 19 |
+ ] |
@@ -795,6 +795,7 @@ class MemberActivityContributionWelfareInfo(BaseModelMixin, BrandInfoMixin): |
||
| 795 | 795 |
|
| 796 | 796 |
|
| 797 | 797 |
class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMixin): |
| 798 |
+ WELFARE_INTEGRAL = 1 |
|
| 798 | 799 |
WELFARE_TYPE = ( |
| 799 | 800 |
(0, u'实物'), |
| 800 | 801 |
(1, u'积分'), |
@@ -811,6 +812,8 @@ class MemberActivityContributionWelfareUnlockingInfo(BaseModelMixin, BrandInfoMi |
||
| 811 | 812 |
contribution_id = models.CharField(_(u'contribution_id'), max_length=32, blank=True, null=True, help_text=u'投稿唯一标识', db_index=True) |
| 812 | 813 |
|
| 813 | 814 |
welfare_id = models.CharField(_(u'welfare_id'), max_length=32, blank=True, null=True, help_text=u'福利唯一标识', db_index=True) |
| 815 |
+ welfare_type = models.IntegerField(_(u'welfare_type'), choices=WELFARE_TYPE, default=0, help_text=u'福利类型', db_index=True) |
|
| 816 |
+ welfare_value = models.IntegerField(_(u'welfare_value'), default=0, help_text=_(u'福利数量')) |
|
| 814 | 817 |
|
| 815 | 818 |
name = models.CharField(_(u'name'), max_length=255, blank=True, null=True, help_text=u'姓名') |
| 816 | 819 |
phone = models.CharField(_(u'phone'), max_length=255, blank=True, null=True, help_text=u'电话') |
@@ -318,19 +318,20 @@ def user_integral_add(request): |
||
| 318 | 318 |
return response(ProductBrandStatusCode.BRAND_NOT_MATCH) |
| 319 | 319 |
|
| 320 | 320 |
try: |
| 321 |
- user = UserInfo.objects.get(user_id=user_id, status=True) |
|
| 321 |
+ user = UserInfo.objects.select_for_update().get(user_id=user_id, status=True) |
|
| 322 | 322 |
except UserInfo.DoesNotExist: |
| 323 | 323 |
return response(UserStatusCode.USER_NOT_FOUND) |
| 324 | 324 |
|
| 325 |
+ user.integral += integral |
|
| 326 |
+ user.save() |
|
| 327 |
+ |
|
| 325 | 328 |
UserIntegralIncomeExpensesInfo.objects.create( |
| 326 | 329 |
brand_id=brand_id, |
| 327 | 330 |
user_id=user_id, |
| 328 | 331 |
integral_from=UserIntegralIncomeExpensesInfo.CONTRIBUTE, |
| 329 | 332 |
integral=integral, |
| 330 |
- remark=remark |
|
| 333 |
+ final_integral=user.integral, |
|
| 334 |
+ remark=remark, |
|
| 331 | 335 |
) |
| 332 | 336 |
|
| 333 |
- user.integral += integral |
|
| 334 |
- user.save() |
|
| 335 |
- |
|
| 336 | 337 |
return response(200, 'Add User Integral Success', u'添加用户投稿积分成功') |
@@ -8,6 +8,78 @@ class ParamStatusCode(BaseStatusCode): |
||
| 8 | 8 |
PARAM_NOT_FOUND = StatusCodeField(400000, 'Param Not Found', description=u'参数不存在') |
| 9 | 9 |
|
| 10 | 10 |
|
| 11 |
+class PermissionStatusCode(BaseStatusCode): |
|
| 12 |
+ """ 4099xx 权限相关错误码 """ |
|
| 13 |
+ PERMISSION_DENIED = StatusCodeField(409900, 'Permission Denied', description=u'权限不足') |
|
| 14 |
+ |
|
| 15 |
+ |
|
| 16 |
+class AdministratorStatusCode(BaseStatusCode): |
|
| 17 |
+ """ 操作员相关错误码 4002xx """ |
|
| 18 |
+ ADMINISTRATOR_NOT_FOUND = StatusCodeField(400201, 'Administrator Not Found', description=u'管理员不存在') |
|
| 19 |
+ ADMINISTRATOR_PERMISSION_DENIED = StatusCodeField(508002, 'Administrator Permission Denied', description=u'管理员权限不足') |
|
| 20 |
+ |
|
| 21 |
+ # 密码 |
|
| 22 |
+ ADMINISTRATOR_PASSWORD_ERROR = StatusCodeField(400202, 'Administrator Password Error', description=u'管理员密码错误') |
|
| 23 |
+ # 手机号 |
|
| 24 |
+ ADMINISTRATOR_PHONE_ALREADY_EXISTS = StatusCodeField(400205, 'Administrator Phone Already Exists', description=u'管理员手机号已经存在') |
|
| 25 |
+ # 状态 |
|
| 26 |
+ ADMINISTRATOR_NOT_ACTIVATED = StatusCodeField(400215, 'Administrator Not Activated', description=u'管理员未激活') |
|
| 27 |
+ ADMINISTRATOR_HAS_DISABLED = StatusCodeField(400216, 'Administrator Has Disabled', description=u'管理员已禁用') |
|
| 28 |
+ ADMINISTRATOR_HAS_DELETED = StatusCodeField(400217, 'Administrator Has Deleted', description=u'管理员已删除') |
|
| 29 |
+ # 管理员 |
|
| 30 |
+ MAINTENANCE_NOT_FOUND = StatusCodeField(400251, 'Maintenance Not Found', description=u'核销员不存在') |
|
| 31 |
+ |
|
| 32 |
+ |
|
| 33 |
+class OperatorStatusCode(BaseStatusCode): |
|
| 34 |
+ """ 操作员相关错误码 4003xx """ |
|
| 35 |
+ OPERATOR_NOT_FOUND = StatusCodeField(400301, 'Operator Not Found', description=u'操作员不存在') |
|
| 36 |
+ # 密码 |
|
| 37 |
+ OPERATOR_PASSWORD_ERROR = StatusCodeField(400302, 'Operator Password Error', description=u'操作员密码错误') |
|
| 38 |
+ # 手机号 |
|
| 39 |
+ OPERATOR_PHONE_ALREADY_EXISTS = StatusCodeField(400305, 'Operator Phone Already Exists', description=u'操作员手机号已经存在') |
|
| 40 |
+ # 状态 |
|
| 41 |
+ OPERATOR_NOT_ACTIVATED = StatusCodeField(400315, 'Operator Not Activated', description=u'操作员未激活') |
|
| 42 |
+ OPERATOR_HAS_DISABLED = StatusCodeField(400316, 'Operator Has Disabled', description=u'操作员已禁用') |
|
| 43 |
+ OPERATOR_HAS_DELETED = StatusCodeField(400317, 'Operator Has Deleted', description=u'操作员已删除') |
|
| 44 |
+ |
|
| 45 |
+ |
|
| 46 |
+class UserStatusCode(BaseStatusCode): |
|
| 47 |
+ """ 用户相关错误码 4005xx """ |
|
| 48 |
+ USER_NOT_FOUND = StatusCodeField(400501, 'User Not Found', description=u'用户不存在') |
|
| 49 |
+ USER_PASSWORD_ERROR = StatusCodeField(400502, 'User Password Error', description=u'用户密码错误') |
|
| 50 |
+ USERNAME_HAS_REGISTERED = StatusCodeField(400503, 'Username Has Registered', description=u'用户名已注册') |
|
| 51 |
+ # 游客 |
|
| 52 |
+ GUEST_NOT_ALLOWED = StatusCodeField(400511, 'Guest Not ALLOWED', description=u'游客登录未开启') |
|
| 53 |
+ # 身份 |
|
| 54 |
+ USER_NOT_LENSMAN = StatusCodeField(400521, 'User Not Lensman', description=u'用户非摄影师') |
|
| 55 |
+ USER_NOT_TOURGUIDE = StatusCodeField(400522, 'User Not Tourguide', description=u'用户非导游') |
|
| 56 |
+ |
|
| 57 |
+ |
|
| 58 |
+class PhoneStatusCode(BaseStatusCode): |
|
| 59 |
+ """ 手机相关错误码 4006xx """ |
|
| 60 |
+ PHONE_NOT_FOUND = StatusCodeField(400601, 'Phone Not Found', description=u'手机不存在') |
|
| 61 |
+ |
|
| 62 |
+ |
|
| 63 |
+class WechatStatusCode(BaseStatusCode): |
|
| 64 |
+ """ 微信相关错误码 4007xx """ |
|
| 65 |
+ WECHAT_NOT_FOUND = StatusCodeField(400701, 'Wechat Not Found', description=u'微信不存在') |
|
| 66 |
+ UNIONID_NOT_FOUND = StatusCodeField(400702, 'Unionid Not Found', description=u'微信 UNIONID 不存在') |
|
| 67 |
+ OPENID_NOT_FOUND = StatusCodeField(400703, 'OPENID Not Found', description=u'微信 OPENID 不存在') |
|
| 68 |
+ |
|
| 69 |
+ |
|
| 70 |
+class ScreenStatusCode(BaseStatusCode): |
|
| 71 |
+ """ 群组/团相关错误码 4030xx """ |
|
| 72 |
+ QRCODE_NOT_SCAN = StatusCodeField(403001, 'QRCode Not Scan', description=u'二维码未扫描') |
|
| 73 |
+ |
|
| 74 |
+ |
|
| 75 |
+class CouponStatusCode(BaseStatusCode): |
|
| 76 |
+ """ 4050xx 优惠劵相关错误码 """ |
|
| 77 |
+ COUPON_NOT_FOUND = StatusCodeField(405001, 'Coupon Not Found', description=u'劵不存在') |
|
| 78 |
+ COUPON_EXPIRED = StatusCodeField(405002, 'Coupon Expired', description=u'劵已过期') |
|
| 79 |
+ COUPON_PERMISSION_DENIED = StatusCodeField(405003, 'Permission Denied', description=u'核销劵权限不足') |
|
| 80 |
+ COUPON_HAS_USED = StatusCodeField(405004, 'Coupon Has Used', description=u'劵已核销') |
|
| 81 |
+ |
|
| 82 |
+ |
|
| 11 | 83 |
class SaleclerkStatusCode(BaseStatusCode): |
| 12 | 84 |
""" 店员相关错误码 5001xx """ |
| 13 | 85 |
CLERK_NOT_FOUND = StatusCodeField(500101, 'Clerk Not Found', description=u'店员不存在') |
@@ -107,7 +179,8 @@ class MemberActivityContributionWelfareStatusCode(BaseStatusCode): |
||
| 107 | 179 |
|
| 108 | 180 |
class MemberActivityContributionWelfareUnblockingStatusCode(BaseStatusCode): |
| 109 | 181 |
""" 会员活动投稿福利相关错误码 5039xx """ |
| 110 |
- ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_NOT_FOUND = StatusCodeField(503999, 'Activity Contribution Welfare Unblocking Not Found', description=u'活动投稿福利解锁不存在') |
|
| 182 |
+ ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_NOT_FOUND = StatusCodeField(503901, 'Activity Contribution Welfare Unblocking Not Found', description=u'活动投稿福利解锁不存在') |
|
| 183 |
+ ACTIVITY_CONTRIBUTION_WELFARE_UNBLOCKING_HAS_HANDLED = StatusCodeField(503902, 'Activity Contribution Welfare Unblocking Has Handled', description=u'活动投稿福利解锁已处理') |
|
| 111 | 184 |
|
| 112 | 185 |
|
| 113 | 186 |
class MemberCouponStatusCode(BaseStatusCode): |
@@ -138,75 +211,3 @@ class MaintenanceStatusCode(BaseStatusCode): |
||
| 138 | 211 |
""" 维修相关错误码 5080xx """ |
| 139 | 212 |
MAINTENACE_NOT_FOUND = StatusCodeField(508001, 'Maintenance Not Found', description=u'维修不存在') |
| 140 | 213 |
MAINTENACE_PERMISSION_DENIED = StatusCodeField(508002, 'Maintenance Permission Denied', description=u'维修权限不足') |
| 141 |
- |
|
| 142 |
- |
|
| 143 |
-class AdministratorStatusCode(BaseStatusCode): |
|
| 144 |
- """ 操作员相关错误码 4002xx """ |
|
| 145 |
- ADMINISTRATOR_NOT_FOUND = StatusCodeField(400201, 'Administrator Not Found', description=u'管理员不存在') |
|
| 146 |
- ADMINISTRATOR_PERMISSION_DENIED = StatusCodeField(508002, 'Administrator Permission Denied', description=u'管理员权限不足') |
|
| 147 |
- |
|
| 148 |
- # 密码 |
|
| 149 |
- ADMINISTRATOR_PASSWORD_ERROR = StatusCodeField(400202, 'Administrator Password Error', description=u'管理员密码错误') |
|
| 150 |
- # 手机号 |
|
| 151 |
- ADMINISTRATOR_PHONE_ALREADY_EXISTS = StatusCodeField(400205, 'Administrator Phone Already Exists', description=u'管理员手机号已经存在') |
|
| 152 |
- # 状态 |
|
| 153 |
- ADMINISTRATOR_NOT_ACTIVATED = StatusCodeField(400215, 'Administrator Not Activated', description=u'管理员未激活') |
|
| 154 |
- ADMINISTRATOR_HAS_DISABLED = StatusCodeField(400216, 'Administrator Has Disabled', description=u'管理员已禁用') |
|
| 155 |
- ADMINISTRATOR_HAS_DELETED = StatusCodeField(400217, 'Administrator Has Deleted', description=u'管理员已删除') |
|
| 156 |
- # 管理员 |
|
| 157 |
- MAINTENANCE_NOT_FOUND = StatusCodeField(400251, 'Maintenance Not Found', description=u'核销员不存在') |
|
| 158 |
- |
|
| 159 |
- |
|
| 160 |
-class OperatorStatusCode(BaseStatusCode): |
|
| 161 |
- """ 操作员相关错误码 4003xx """ |
|
| 162 |
- OPERATOR_NOT_FOUND = StatusCodeField(400301, 'Operator Not Found', description=u'操作员不存在') |
|
| 163 |
- # 密码 |
|
| 164 |
- OPERATOR_PASSWORD_ERROR = StatusCodeField(400302, 'Operator Password Error', description=u'操作员密码错误') |
|
| 165 |
- # 手机号 |
|
| 166 |
- OPERATOR_PHONE_ALREADY_EXISTS = StatusCodeField(400305, 'Operator Phone Already Exists', description=u'操作员手机号已经存在') |
|
| 167 |
- # 状态 |
|
| 168 |
- OPERATOR_NOT_ACTIVATED = StatusCodeField(400315, 'Operator Not Activated', description=u'操作员未激活') |
|
| 169 |
- OPERATOR_HAS_DISABLED = StatusCodeField(400316, 'Operator Has Disabled', description=u'操作员已禁用') |
|
| 170 |
- OPERATOR_HAS_DELETED = StatusCodeField(400317, 'Operator Has Deleted', description=u'操作员已删除') |
|
| 171 |
- |
|
| 172 |
- |
|
| 173 |
-class UserStatusCode(BaseStatusCode): |
|
| 174 |
- """ 用户相关错误码 4005xx """ |
|
| 175 |
- USER_NOT_FOUND = StatusCodeField(400501, 'User Not Found', description=u'用户不存在') |
|
| 176 |
- USER_PASSWORD_ERROR = StatusCodeField(400502, 'User Password Error', description=u'用户密码错误') |
|
| 177 |
- USERNAME_HAS_REGISTERED = StatusCodeField(400503, 'Username Has Registered', description=u'用户名已注册') |
|
| 178 |
- # 游客 |
|
| 179 |
- GUEST_NOT_ALLOWED = StatusCodeField(400511, 'Guest Not ALLOWED', description=u'游客登录未开启') |
|
| 180 |
- # 身份 |
|
| 181 |
- USER_NOT_LENSMAN = StatusCodeField(400521, 'User Not Lensman', description=u'用户非摄影师') |
|
| 182 |
- USER_NOT_TOURGUIDE = StatusCodeField(400522, 'User Not Tourguide', description=u'用户非导游') |
|
| 183 |
- |
|
| 184 |
- |
|
| 185 |
-class PhoneStatusCode(BaseStatusCode): |
|
| 186 |
- """ 手机相关错误码 4006xx """ |
|
| 187 |
- PHONE_NOT_FOUND = StatusCodeField(400601, 'Phone Not Found', description=u'手机不存在') |
|
| 188 |
- |
|
| 189 |
- |
|
| 190 |
-class WechatStatusCode(BaseStatusCode): |
|
| 191 |
- """ 微信相关错误码 4007xx """ |
|
| 192 |
- WECHAT_NOT_FOUND = StatusCodeField(400701, 'Wechat Not Found', description=u'微信不存在') |
|
| 193 |
- UNIONID_NOT_FOUND = StatusCodeField(400702, 'Unionid Not Found', description=u'微信 UNIONID 不存在') |
|
| 194 |
- OPENID_NOT_FOUND = StatusCodeField(400703, 'OPENID Not Found', description=u'微信 OPENID 不存在') |
|
| 195 |
- |
|
| 196 |
- |
|
| 197 |
-class ScreenStatusCode(BaseStatusCode): |
|
| 198 |
- """ 群组/团相关错误码 4030xx """ |
|
| 199 |
- QRCODE_NOT_SCAN = StatusCodeField(403001, 'QRCode Not Scan', description=u'二维码未扫描') |
|
| 200 |
- |
|
| 201 |
- |
|
| 202 |
-class PermissionStatusCode(BaseStatusCode): |
|
| 203 |
- """ 4099xx 权限相关错误码 """ |
|
| 204 |
- PERMISSION_DENIED = StatusCodeField(409900, 'Permission Denied', description=u'权限不足') |
|
| 205 |
- |
|
| 206 |
- |
|
| 207 |
-class CouponStatusCode(BaseStatusCode): |
|
| 208 |
- """ 4050xx 优惠劵相关错误码 """ |
|
| 209 |
- COUPON_NOT_FOUND = StatusCodeField(405001, 'Coupon Not Found', description=u'劵不存在') |
|
| 210 |
- COUPON_EXPIRED = StatusCodeField(405002, 'Coupon Expired', description=u'劵已过期') |
|
| 211 |
- COUPON_PERMISSION_DENIED = StatusCodeField(405003, 'Permission Denied', description=u'核销劵权限不足') |
|
| 212 |
- COUPON_HAS_USED = StatusCodeField(405004, 'Coupon Has Used', description=u'劵已核销') |